#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	int t;
	scanf("%d",&t);
	while(t--)
	{
		int n;
		scanf("%d",&n);
		printf("%d",n);
		for(int i = n-1;i>=1;i--) printf(" %d",i);
		printf("\n");
	}
}
 
